From e0ab2840dbf721af92682cb8a6495a86a9e643e6 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 23 Aug 2011 18:33:28 +0000 Subject: [PATCH] * (bug 30497) Add client-nojs and client-js classes on document element to let styles easily hide or show things based on general JS availability Patch by John Du Hart - https://bugzilla.wikimedia.org/attachment.cgi?id=8956 --- RELEASE-NOTES-1.19 | 2 ++ includes/OutputPage.php | 2 +- resources/mediawiki.page/mediawiki.page.startup.js | 14 ++++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index a59e47dea0..3ab5850730 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -16,6 +16,8 @@ production. * Default cookie lifetime ($wgCookieExpiration) is increased to 180 days. === New features in 1.19 === +* (bug 30497) Add client-nojs and client-js classes on document element + to let styles easily hide or show things based on general JS availability * (bug 19838) Possibility to get all interwiki prefixes if the interwiki cache is used. * $wgDnsBlacklistUrls now accepts an array with url and key as the diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 0a6af95282..a80e3156b1 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2223,7 +2223,7 @@ $templates $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' ); } - $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir ) ); + $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); if ( $this->getHTMLTitle() == '' ) { $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) ); diff --git a/resources/mediawiki.page/mediawiki.page.startup.js b/resources/mediawiki.page/mediawiki.page.startup.js index 163dbf3f53..c601c290f2 100644 --- a/resources/mediawiki.page/mediawiki.page.startup.js +++ b/resources/mediawiki.page/mediawiki.page.startup.js @@ -5,11 +5,13 @@ /* Client profile classes for */ var prof = $.client.profile(); - $( 'html' ).addClass( - 'client-' + prof.name - + ' client-' + prof.name + '-' + prof.versionBase - + ' client-' + prof.layout - + ' client-' + prof.platform - ); + $( 'html' ) + .addClass( + 'client-' + prof.name + + ' client-' + prof.name + '-' + prof.versionBase + + ' client-' + prof.layout + + ' client-' + prof.platform + + ' client-js' ) + .removeClass( 'client-nojs' ); } )( jQuery ); -- 2.20.1